package thread;

public class Demo24 {
    public static void main(String[] args) throws InterruptedException {
        Object object = new Object();
        System.out.println("等待之前");
        synchronized (object) {
            object.wait();//wait的机制是解锁同时进行等待，因此得先获取到锁
        }
        System.out.println("等待之后");
    }
}
